package edu.lsnu.equipment_management_system.service;

import edu.lsnu.equipment_management_system.exception.*;
import edu.lsnu.equipment_management_system.pojo.po.entity.EquipmentUseRecordTablePo;
import edu.lsnu.equipment_management_system.pojo.po.entity.UserTablePo;
import edu.lsnu.equipment_management_system.pojo.vo.in.*;

import javax.servlet.http.HttpSession;

/**
 * @author mzy
 * @Description 插入的时候一簇一簇的事务合集操作：包括值为空的判断
 *      例如：
 *          设备转让
 *          设备购入
 *          设备调入
 *          设备调出
 *          [设备报损报废?] [设备维修维护?]
 * @date 2018/11/26
 */
public interface TransactionalCollectionService {
    /** [增加用户] */
    boolean adminAddUser(UserTablePo userTablePo) throws NoExistException, UserNoException, NotNumericException;

    /** 设备转让 */
    boolean equipmentChangeUser(EquipmentUseRecordTablePo equipmentUseRecordTablePo, HttpSession session) throws NoPowerException, NoNotExistException, InsertIntoEquipmentUseRecordTableException;

    /** 设备购入 */
    boolean userEquipmentPurchase(EquipmentPurchaseFromPage equipmentPurchaseFromPage,
                                  HttpSession session) throws NoExistException, EquipmentNoSizeNotEqualNumberException, InputEquipmentNoRepeatException, NotNumericException, EquipmentNoEexception, InsertIntoEquipmentUseRecordTableException;
    /** 设备调入 */
    boolean userEquipmentTransferIn(EquipmentTransferInFromPage equipmentTransferInFromPage,
                                    HttpSession session) throws NoExistException, EquipmentNoSizeNotEqualNumberException, InputEquipmentNoRepeatException, NotNumericException, EquipmentNoEexception, InsertIntoEquipmentUseRecordTableException;

    /** [设备调出] */
    boolean userEquipmentTransferOut(EquipmentTransferOutFromPage equipmentTransferOutFromPage,
                                     HttpSession session) throws NoNotExistException, NoPowerException;

    /** [设备报损报废] */
    boolean userEquipmentDamage(EquipmentDamageFromPage equipmentDamageFromPage,
                                HttpSession session) throws NoNotExistException, NoPowerException;
    /** [设备维修维护] */
    boolean userEquipmentRepair(EquipmentRepairFromPage equipmentRepairFromPage,
                                HttpSession session) throws NoNotExistException, NoPowerException, InsertIntoEquipmentRepairTableException;
}
